[HVM] add super page support for HVM migration
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Aug 2009 09:12:41 +0000 (10:12 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 27 Aug 2009 09:12:41 +0000 (10:12 +0100)
commit4062d9c27bb9d0551e94b28626e78b35f931ef14
tree2f74017caf1f03bb0e7bf09a4e5e3b5048b69cb6
parent7a530cd96815c1e9e1f132eceeafdc4f3a467094
[HVM] add super page support for HVM migration

This patch try to allocate 2M pages on target side based on analysis
of pfn sequence sent from source side for HVM migration.

The algorithm is: If pseudo-phys page is not yet populated in target
domain, AND it is first page of a 2MB extent, AND no other pages in
that extent are yet populated, AND the next pages in the save-image
stream populate that extent in order, THEN allocate a super page. If
the next 511 pages (to make the 2MB extent) are split across a batch
boundary, we have to optimistically allocate a super page in this
batch, and then break it into several 4K pages in the next batch,
which is speculative.

This patch is also friendly to PV guest migration.

Signed-Off-By: Zhai Edwin <edwin.zhai@intel.com>
tools/libxc/xc_domain_restore.c